@Echo Off

@SET TwelveHiveDir="c:\program files\common files\microsoft shared\web server extensions\12"
@SET STSADM="c:\program files\common files\microsoft shared\web server extensions\12\bin\stsadm"

IF %1==Release (Goto PrepareBuildLocation) ELSE (Goto PrepareDebugEnv)

Goto End

:PrepareBuildLocation

@SET ListCleanupBuildDir=..\..\Build\ListCleanup

Echo Template folder to feature directory
xcopy /e /y 12\* %ListCleanupBuildDir%\12\*

Echo Copy the dll to bin directory
xcopy /Y /I bin\Codeplex.SPCleanup.ApplicationPages.dll %ListCleanupBuildDir%\12\Config\Bin\*

Goto End

:PrepareDebugEnv

Echo Do An Reset before copying as dll is locked in app_bin folder
IISReset /TIMEOUT:0

Echo 12 hive folder 
xcopy /e /y 12\* %TwelveHiveDir%

Echo Copying dll to _app_bin folder
xcopy /e /y bin\Codeplex.SPCleanup.ApplicationPages.dll %TwelveHiveDir%\CONFIG\BIN

Echo Run the appbin copy command to redeploy the sitemap and dll
%STSADM% -o copyappbincontent

Goto End

:End